home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Tool Chest / Testing & Debugging / Virtual User tools / SPEC S&L v.1.0.1 / Scripts / PowerPoint.vu < prev    next >
Encoding:
Text File  |  1993-12-17  |  10.2 KB  |  255 lines  |  [TEXT/MPS ]

  1. #
  2. # ****************************************************************************
  3. #
  4. #    File Name:        PowerPoint.vu
  5. #
  6. #    Contains:    Quick look test script for MSPowerPoint version 4.0
  7. #
  8. #    Written by:    Kevin Avoy, Ken Landreth, Michael Leong, Gil Spencer et al
  9. #
  10. #    Copyright:    © 1993 by Apple Computer, Inc., all rights reserved.
  11. #
  12. # ****************************************************************************
  13. #            C h a n g e        H i s t o r y (most recent first):
  14. # ****************************************************************************
  15. #
  16. #        Vers      Date        Author        Description
  17. #        ----    --------    ------    ---------------------------------------------
  18. #     <1.0.6>     9/30/93    KTA        Initialize gFileName prior to gApptitle being updated by
  19. #                                    launchTwitch().
  20. #     <1.0.2>     6/16/93    NAGA        Renaming InitGlobals(ScriptLevel)to InitGlobals(ScriptLevel)
  21. #        <1+>     5/25/93    NAGA        Adding header and porting old files to follow new standards
  22. #
  23. # ****************************************************************************
  24. #
  25.  
  26.  
  27.  
  28. ########################################################################
  29. #                            External libraries 
  30. #=======================================================================
  31. Libraries "Output.Lib", "DoTasks.Lib","Draw.Lib","UserInterface.Lib", "Font.Lib", "Globals.Lib", "LaunchQuit.Lib", "TCS.Lib";
  32.  
  33.  
  34. #########################################################################
  35. ########               Application Specific Tasks
  36. #########################################################################
  37.  
  38. #########################################################################
  39. #                        InitAppGlobals()
  40. #========================================================================
  41. # Author:        KL
  42. # Description:    Sets up the tool palette for MSPowerPoint.  This task
  43. #                must be called first.
  44. # Parameters:    None
  45. # Returns:        Nothing
  46. # Examples:        InitAppGlobals()
  47. #========================================================================
  48. # History:
  49. #
  50. ########################################################################
  51. task InitAppGlobals()
  52. begin
  53.     
  54.     logstr("setting up {global gApptitle}'s globals");            
  55.     global kClick, kDrag, kMultiDrag, kMultiClickDrag, kMultiClick;
  56.     global kPalDocWind, kPalWind, kPullOffPal, kPopUpPal, kScrollPal;
  57.     global kToolPaletteNum := 1; 
  58.     global kTextAttribPaletteNum := 2;
  59.  
  60.     global gPaletteList :=    {
  61.                             {                        #### Start Palette #1 - Tools
  62.                             {1,44,29,203,0},        # Location of tools palette relative to the window
  63.                             kPalDocWind,            # Palette type
  64.                             {1,8},                    # Size of Tool matrix {numElemsWide,numElemsTall}
  65.                             {0,20},                    # Offset between tools {h,v}
  66.                             0,                        # Not used at this time
  67.                             0                        # Not used at this time
  68.                             },                        #### End Palette #1
  69.                             
  70.                             {                        #### Start Palette #2 - TextAttrib
  71.                             {168,23,268,39,0},        # Location of TextAttrib palette relative to the window
  72.                             kPalDocWind,            # Palette type
  73.                             {5,1},                    # Size of Tool matrix {numElemsWide,numElemsTall}
  74.                             {21,0},                    # Offset between tools {h,v}
  75.                             0,                        # Not used at this time
  76.                             0                        # Not used at this time
  77.                             }                        #### End Palette #2
  78.                             
  79.     };
  80.     
  81.  
  82.     ### MSPowerPoint                                                                            {Flag, Pattern, Line, Color}
  83.     ### Palette Elements:=           Tool#, Pal#,         ToolName,             ToolType,    DblClktoEnd        SetAttributes
  84.     global SelectTool :=             { 1,    1,            "Select",            kClick,            0,                {0}                };
  85.     global TextTool :=                 { 2,       1,            "Text",                kClick,            0,                {}                };
  86.     global LineTool :=                 { 3,    1,            "Line",                kDrag,            0,                {0}                };
  87.     global ArcTool :=                { 4,    1,            "Arc",                kDrag,            0,                {0}                };
  88.     global FreeFormTool :=             { 5,    1,            "FreeForm",            kMultiClick,    1,                {0}                };
  89.     global RectTool :=                 { 6,       1,            "Rect",                kDrag,            0,                {0}                };
  90.     global EllipseTool :=             { 7,       1,            "Ellipse",            kDrag,            0,                {0}                };
  91.     global ShapeTool :=             { 8,    1,            "Shape",            kDrag,            0,                {0}                };
  92.     
  93.     global BoldTextTool :=             { 1,    2,            "BoldText",            0,                 0,                {0}                };
  94.     global ItalicTextTool :=         { 2,    2,            "ItalicText",        0,                 0,                {0}                };
  95.     global UnderlineTextTool :=        { 3,    2,            "UnderlineText",    0,                 0,                {0}                };
  96.     global ShowdowTextTool :=        { 4,    2,            "ShowdowText",        0,                 0,                {0}                };
  97.     global BulletTool :=            { 5,    2,            "Bullet",            0,                0,                {0}                };
  98.     
  99.  
  100.     global PromoteTool :=             {'',  {  18, 31,1},    "Promote",            0,                 0,                {0}                };
  101.     global DemoteTool :=             {'',  {  39, 31,1},    "Demote",            0,                 0,                {0}                };
  102.     global MoveUpTool :=             {'',  {  63, 31,1},    "MoveUp",            0,                 0,                {0}                };
  103.     global MoveDownTool :=             {'',  {  81, 31,1},    "MoveDown",            0,                 0,                {0}                };
  104.     global IncTextSizeTool :=         {'',  { 146, 26,1},    "IncTextSize",        0,                 0,                {0}                };
  105.     global DecTextSizeTool :=         {'',  { 146, 35,1},    "DecTextSize",        0,                 0,                {0}                };
  106.     global LineObjTool :=             {'',  { 293, 31,1},    "LineObj",            0,                0,                {0}                };
  107.     global FillObjTool :=             {'',  { 312, 31,1},    "FillObj",            0,                0,                {0}                };
  108.     global ShadowObjTool :=         {'',  { 333, 31,1},    "ShadowObj",        0,                0,                {0}                };
  109.     global PickUpStyleTool :=        {'',  { 365, 31,1},    "PickUpStyle",        0,                0,                {0}                };
  110.     global ApplyStyleTool :=         {'',  { 386, 31,1},    "ApplyStyle",        0,                0,                {0}                };
  111.     global SlideShowTool :=         {'',  {-109, 31,3},    "SlideShow",        0,                0,                {0}                };
  112.     global ZoomInTool :=             {'',  { -36, 25,3},    "ZoomIn",            0,                0,                {0}                };
  113.     global ZoomOutTool :=             {'',  { -36, 34,3},    "ZoomOut",            0,                0,                {0}                };
  114.     global HomeScaleTool :=         {'',  { -18, 31,3},    "HomeScale",        0,                0,                {0}                };
  115.     
  116.     global PrevSlideTool :=         {'',  {  16,232,1},    "PrevSlide",        0,                0,                {0}                };
  117.     global NextSlideTool :=         {'',  {  15,-26,2},    "NextSlide",        0,                0,                {0}                };
  118.     
  119.     global NewSlideTool :=             {'',  { 17,  -9,2},    "NewSlide",            0,                0,                {0}                };
  120.     
  121.     global SlideViewTool :=         {'',  {162, -10,2},    "SlideView",        0,                0,                {0}                };
  122.     global NotesViewTool :=         {'',  {183, -10,2},    "NotesView",        0,                0,                {0}                };
  123.     global SlideSorterViewTool :=     {'',  {204, -10,2},    "SlideSorterView",    0,                0,                {0}                };
  124.     global OutlineViewTool :=         {'',  {225, -10,2},    "OutlineView",        0,                0,                {0}                };
  125.     
  126.     global gToolList:={    LineTool,
  127.                         ArcTool,
  128.                         FreeFormTool,
  129.                         RectTool,
  130.                         EllipseTool,
  131.                         ShapeTool
  132.                         };
  133.                         
  134.     global gWindowInset := {35,45,20,20};
  135.                         
  136.         ### font characteristic lists
  137.     global gFontSizeList := {'9','10','12','14','18','24','36','48','60','72','96'};
  138.     global gFontStyleList := {'Bold','Italic','Outline', 'Underline','Shadow',
  139.                                 'Emboss', 'Superscript', 'Subscript'};
  140.  
  141.         ### Name of the Plain (style) menu item  ####
  142.     global gPlainStyle := "Plain";            # Plain-Style menu item
  143.  
  144.         ### How to get to the next line
  145.     global gNextLineMethod := 1;            
  146.         ### 1 - ReturnKey,  2 - EnterKey, 3 - DownArrow Key, 4 - TabKey, {} - Move/Click, {'Untitled'} - Move relative to the window titled 'Untitled' /Click
  147.     
  148.         ### Does moving to the next line clear all font info
  149.     global gNextLineClearsFontSettings := 0;                        
  150.  
  151. end;    #InitAppGlobals
  152.  
  153. #########################################################################
  154. #                            Views()
  155. #========================================================================
  156. # Author:        
  157. # Description:    Change views.
  158. # Parameters:    None
  159. # Returns:        Nothing
  160. # Examples:        Views();
  161. # Assumptions:    None 
  162. # Applications:        MSPowerPoint
  163. #========================================================================
  164. # History:
  165. #
  166. ########################################################################
  167. task Views() begin
  168.     LogStr( "Changing Views");
  169.     SelectMenuItem("25%",             "View");
  170.     SelectMenuItem("33%",             "View");
  171.     SelectMenuItem("50%",             "View");
  172.     SelectMenuItem("66%",             "View");
  173.     SelectMenuItem("200%",             "View");
  174.     SelectMenuItem("400%",             "View");
  175.     SelectMenuItem("Actual Size",    "View");
  176.     SelectMenuItem("Notes",         "View");
  177.     SelectMenuItem("Slide Sorter",     "View");
  178.     SelectMenuItem("Outline",         "View");
  179.     SelectMenuItem("Slides",         "View");
  180. end;
  181.  
  182. #########################################################################
  183. #                            PowerPointSetupDoText()
  184. #========================================================================
  185. # Author:        ML
  186. # Description:    Setup document for DoText()
  187. # Parameters:    None
  188. # Returns:        Nothing
  189. # Examples:        PowerPointSetupDoText();
  190. # Assumptions:    None 
  191. # Applications:    PowerPoint
  192. #========================================================================
  193. # History:
  194. #
  195. #########################################################################
  196. task PowerPointSetupDoText()
  197. begin
  198.     logstr("Setting up for DoText()...");
  199.     settool(global TextTool);
  200.     MoveRelativeToWindow();
  201.     pressmouse;
  202.     Wait(1);
  203.     releasemouse;
  204. end;
  205.  
  206. #########################################################################
  207. #                            PowerPointSetupDoDraw()
  208. #========================================================================
  209. # Author:        ML
  210. # Description:    Setup document for DoDraw()
  211. # Parameters:    None
  212. # Returns:        Nothing
  213. # Examples:        PowerPointSetupDoDraw();
  214. # Assumptions:    None 
  215. # Applications:    PowerPoint
  216. #========================================================================
  217. # History:
  218. #
  219. #########################################################################
  220. task PowerPointSetupDoDraw()
  221. begin
  222.     logstr("Setting up for DoDraw...");
  223.     ScrollWindow('H',0,1);        # gets back to content region
  224. end;
  225.  
  226. ################################################################################
  227. ####################             Main script                    ####################
  228. ################################################################################
  229. script PowerPoint (ScriptLevel:= -1)
  230. begin
  231.     InitGlobals(ScriptLevel);            # initialize your general globals
  232.     InitDraw();
  233.     InitFonts();
  234.     global gAppTitle := 'PowerPoint';
  235.     global gAppVersion := '4';        # version of app you will be running
  236.     global gFileName := "@!@-{gBuildVers}-{gAppTitle}";    # This is used in SaveAs when saving files
  237.     SuiteStart('PowerPoint.vu');                    # begin a new test suite
  238.     if LaunchTwitch("{gAppTitle}",gAliasDirectory) # launch or twitch to your app
  239.     begin
  240.         global gSetupDoText:= task PowerPointSetupDoText;    # define app specific task
  241.         global gDoDrawHook1 := task PowerPointSetupDoDraw;
  242.         InitAppGlobals();                                    # init app specific globals
  243.         (*
  244.         *)
  245.         DoSetUpApp(,,,,1,1);
  246.         DoDraw();
  247.         DoText();
  248. #            logstr("!@#$% Expected Error above: The Font styles Emboss, Superscript and Subscript are
  249. #            not always enabled");
  250.         Views();
  251.         DoWindow();
  252.         DoCloseApp();
  253.     end; # if LaunchTwitch("{gAppTitle}",gAliasDirectory)
  254.     SuiteEnd();
  255. end; # script PowerPoint